<template>
  <div class="box">
    <el-row>
      <el-col :span="24">
        <div class="header">
          <el-form
            ref="form"
            :model="form"
            label-width="100px"
            class="flex"
            :rules="rules"
          >
            <div style="margin-left: 10px; width: 386px">
              <el-form-item label="应签日期" prop="date1">
                <el-date-picker
                  @change="datachangeFn()"
                  v-model="value1"
                  style="width: 100%"
                  format="yyyy 年 MM 月 dd 日"
                  value-format="yyyy-MM-dd"
                  type="datetimerange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                >
                </el-date-picker>
              </el-form-item>
            </div>
            <el-form-item label="合并日期" prop="region">
              <el-select
                v-model="form.timeType"
                placeholder="请选择合并日期"
                style="width: 286px"
              >
                <el-option label="是" value="1"></el-option>
                <el-option label="否" value="2"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="onSubmit">查询</el-button>
              <el-button @click="colneFn()"> 重置</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-col>
    </el-row>

    <el-row type="flex" justify="space-between">
      <el-col :span="6">
        <div>当前页共{{ total }}项</div>
      </el-col>
    </el-row>
    <el-row type="flex" justify="space-between">
      <el-col :span="24">
        <el-table max-height="550" :data="tableData" border style="width: 100%">
          <el-table-column fixed prop="collectDate" label="日期">
          </el-table-column>
          <el-table-column fixed prop="networkName" label="网点">
          </el-table-column>
          <el-table-column prop="belong" label="所属省区"> </el-table-column>
          <el-table-column prop="signedTotal" label="应答量"> </el-table-column>
          <el-table-column label="48小时签收考核">
            <el-table-column prop="d1SignRateGoal" label="签收率目标值">
            </el-table-column>
            <el-table-column prop="d1Goal" label="目标应签收量">
            </el-table-column>
            <el-table-column prop="d1Total" label="实际签收量">
            </el-table-column>
            <el-table-column prop="d1NoSignTotal" label="未按时签收量">
            </el-table-column>
            <el-table-column prop="d1SignRate" label="签收率">
            </el-table-column>
            <el-table-column prop="d1NoStandardTotal" label="考核量">
            </el-table-column>
            <el-table-column prop="d1Penalty" label="考核标准">
            </el-table-column>
            <el-table-column prop="d1Amount" label="考核金额">
            </el-table-column>
            <el-table-column prop="d2SignRateGoal" label="签收量目标值">
            </el-table-column>
            <el-table-column prop="d2Goal" label="目标值应签量">
            </el-table-column>
            <el-table-column prop="d2Total" label="实际签收量">
            </el-table-column>
            <el-table-column prop="d2NoSignTotal" label="未按时签收量">
            </el-table-column>
            <el-table-column prop="d2SignRate" label="签收率">
            </el-table-column>
            <el-table-column prop="d2NoStandardTotal" label="考核量">
            </el-table-column>
            <el-table-column prop="d2Penalty" label="考核标准">
            </el-table-column>
            <el-table-column prop="d2Amount" label="考核金额">
            </el-table-column>
            <el-table-column prop="d3SignRateGoal" label="签收率目标值">
            </el-table-column>
            <el-table-column prop="d3Goal" label="目标值应签量">
            </el-table-column>
            <el-table-column prop="d3Total" label="实际签收量">
            </el-table-column>
            <el-table-column prop="d3NoSignTotal" label="未按时签收量">
            </el-table-column>
            <el-table-column prop="d3SignRate" label="签收率">
            </el-table-column>
            <el-table-column prop="d3NoStandardTotal" label="考核量">
            </el-table-column>
            <el-table-column prop="d3Penalty" label="考核标准">
            </el-table-column>
            <el-table-column prop="d3Amount" label="考核金额">
            </el-table-column>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
    <div class="block" style="display: flex; justify-content: flex-end">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage4"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
import { ardExamineApi } from "@/api/receive";
export default {
  data() {
    return {
      value1: "",
      currentPage4: 1,
      form: {
        endTime: "",
        pageDate: {
          pageNum: 1,
          pageSize: 20,
        },
        startTime: "",
        timeType: "",
      },
      rules: {
        region: [
          { required: true, message: "请选择合并日期", trigger: "blur" },
        ],
        date1: [
          {
            type: "date",
            required: true,
            message: "请选择日期",
            trigger: "blur",
          },
        ],
      },
      ul: {
        title: "投诉赔偿款",
        ticket: "29",
        num: "12",
      },
      ul2: {
        title: "投诉赔偿款",
        ticket: "29",
        num: "12",
      },
      tableData: [],
      total: 0,
      activeName: "first",
    };
  },
  methods: {
    onSubmit() {
      this.getListFn();
    },
    async getListFn() {
      let res = await ardExamineApi(this.form);
      if (res.code == 200) {
        this.tableData = res.data.list.data;
        this.total = res.data.list.total;
      }
    },
    datachangeFn(val) {
      console.log(this.value1, "时间");
      if (this.value1 !== null) {
        if (this.value1.length > 0) {
          this.form.startTime = this.value1[0];
          this.form.endTime = this.value1[1];
        }
      } else {
        this.form.startTime = "";
        this.form.endTime = "";
      }
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
    colneFn() {
      this.value1 = [];
      this.form.Integer = "";
    },
    //每页条数
    handleSizeChange(val) {
      this.form.pageDate.pageSize = val;
      this.getListFn();
      console.log("每页", val);
    },
    // 当前页
    handleCurrentChange() {
      this.form.pageDate.pageNum = val;
      this.getListFn();
      console.log("当前页", val);
    },
  },
};
</script>
<style lang="scss" scoped>
.box {
  padding: 0px 20px;
}

.flex {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}
.liLittle {
  border: 1px solid #9999;
  height: 150px;
  display: flex;
  flex-flow: column;
  justify-content: space-around;
}
.liLittle > span {
  font-size: 24px;
}
.f-row {
  display: flex;
  flex-flow: row;
  justify-content: space-around;
}
.littbox {
  display: flex;
  flex-flow: column;
  justify-content: space-around;
  height: 100px;
}

.flex-bettom {
  display: flex;
  justify-content: space-between;
}

.header {
  padding: 20px 0;
  border-bottom: 1px solid #ccc;
}

.el-row {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0;
  }
}

.el-col {
  border-radius: 4px;
}

.bg-purple-dark {
  background: #99a9bf;
}

.bg-purple {
  background: #d3dce6;
}

.bg-purple-light {
  background: #e5e9f2;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
